android.ndk.asset_manager

@file asset_manager.h

Members

Enums

AASSET_MODE_UNKNOWN
enum AASSET_MODE_UNKNOWN

Available access modes for opening assets with {@link AAssetManager_open}

Functions

AAssetDir_close
void AAssetDir_close(AAssetDir* assetDir)

Close an opened AAssetDir, freeing any related resources.

AAssetDir_getNextFileName
const(char)* AAssetDir_getNextFileName(AAssetDir* assetDir)

Iterate over the files in an asset directory. A NULL string is returned when all the file names have been returned.

AAssetDir_rewind
void AAssetDir_rewind(AAssetDir* assetDir)

Reset the iteration state of AAssetDir_getNextFileName() to the beginning.

AAssetManager_open
AAsset* AAssetManager_open(AAssetManager* mgr, const(char)* filename, int mode)

Open an asset.

AAssetManager_openDir
AAssetDir* AAssetManager_openDir(AAssetManager* mgr, const(char)* dirName)

Open the named directory within the asset hierarchy. The directory can then be inspected with the AAssetDir functions. To open the top-level directory, pass in "" as the dirName.

AAsset_close
void AAsset_close(AAsset* asset)

Close the asset, freeing all associated resources.

AAsset_getBuffer
const(void)* AAsset_getBuffer(AAsset* asset)

Get a pointer to a buffer holding the entire contents of the assset.

AAsset_getLength
off_t AAsset_getLength(AAsset* asset)

Report the total size of the asset data.

AAsset_getLength64
off64_t AAsset_getLength64(AAsset* asset)

Report the total size of the asset data. Reports the size using a 64-bit number insted of 32-bit as AAsset_getLength.

AAsset_getRemainingLength
off_t AAsset_getRemainingLength(AAsset* asset)

Report the total amount of asset data that can be read from the current position.

AAsset_getRemainingLength64
off64_t AAsset_getRemainingLength64(AAsset* asset)

Report the total amount of asset data that can be read from the current position.

AAsset_isAllocated
int AAsset_isAllocated(AAsset* asset)

Returns whether this asset's internal buffer is allocated in ordinary RAM (i.e. not mmapped).

AAsset_openFileDescriptor
int AAsset_openFileDescriptor(AAsset* asset, off_t* outStart, off_t* outLength)

Open a new file descriptor that can be used to read the asset data. If the start or length cannot be represented by a 32-bit number, it will be truncated. If the file is large, use AAsset_openFileDescriptor64 instead.

AAsset_openFileDescriptor64
int AAsset_openFileDescriptor64(AAsset* asset, off64_t* outStart, off64_t* outLength)

Open a new file descriptor that can be used to read the asset data.

AAsset_read
int AAsset_read(AAsset* asset, void* buf, size_t count)

Attempt to read 'count' bytes of data from the current offset.

AAsset_seek
off_t AAsset_seek(AAsset* asset, off_t offset, int whence)

Seek to the specified offset within the asset data. 'whence' uses the same constants as lseek()/fseek().

AAsset_seek64
off64_t AAsset_seek64(AAsset* asset, off64_t offset, int whence)

Seek to the specified offset within the asset data. 'whence' uses the same constants as lseek()/fseek().

Structs

AAsset
struct AAsset

{@link AAssetDir} provides access to a chunk of the asset hierarchy as if it were a single directory. The contents are populated by the {@link AAssetManager}.

AAssetDir
struct AAssetDir

{@link AAssetManager} provides access to an application's raw assets by creating {@link AAsset} objects.

Meta